<?php  
define('SINA_SAE', '0'); //是否启用新浪SAE平台1为使用0为不使用  
 $ayurl="http://match.2012.sina.com.cn/medals/"; 
// $content=fcontents($ayurl);
$context = stream_context_create(array('http' => array('header'=>'Connection: close')));
$content=file_get_contents($ayurl,false,$context);
//$content=file_get_contents($ayurl); 
//$content=get_url($ayurl); 
//$ch = curl_init();
//curl_setopt($ch, CURLOPT_URL, $ayurl);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//$content = curl_exec($ch);

preg_match_all('|<div class=\"p_cont\">(.*)</table>|isU',$content,$table);  
echo '  
<html lang="zh-CN" xml:lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml">  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />   
<title></title>  
<meta name="description" content="" />  
<meta name="keywords" content="" />  
<style>  
.tit.tit_no {height: 24px;padding: 10px;}  
.fR {float: right;}.fL {float: left;}  
table.tb_02.tb_04 {font-family: Arial,Helvetica,sans-serif;width: 100%;}  
table {border-collapse: collapse;border-spacing: 0;margin: 1em;border: 1px #ccc solid;}  
table.tb_02.tb_04 th {background: none repeat scroll 0 0 #F1F3F4;color: #0C48A0;font-size: 14px;font-weight: bold;height: 28px;text-align: center;border: 1px #ccc solid;}  
table.tb_02.tb_04 td {color: #000000;font-size: 14px;height: 28px;line-height: 28px;text-align: center;border: 1px #ccc solid;}  
table.tb_02.tb_04 th.w02, table.tb_02.tb_04 td.w02 {padding-left: 16px;text-align: left;border: 1px #ccc solid;}  
 table.tb_02.tb_04 td.w03 {color: #DD0000;}  
table.tb_02.tb_04 td.blue {color: #00509C;}
tbody.sub_show { display:none; }
</style>'.$table[1][0].'</table> <p> www.htkou.net
';  
function fcontents($a){//获取内容  
if(SINA_SAE){  
$f = new SaeFetchurl();  
$content = $f->fetch($a);  
if($f->errno() == 0)  $r=$content;  
else $r=$f->errmsg();  
}else{$r=@file_get_contents($a);}  
return $r;  
}
function get_url($url)
 {
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_TIMEOUT, 5);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  $tmp = curl_exec($ch);
  curl_close($ch);
  return $tmp;
 }?> 